package com.leyou.user.entity;

import com.leyou.common.constants.RegexPatterns;
import com.leyou.common.utils.RegexUtils;
import lombok.Data;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.Pattern;
import java.util.Date;

/**
 * @package com.leyou.user.entity
 * @description:
 * @author: 许超越
 * @date 2019/7/6 17:05
 * @version: V1.0
 */
@Data
@Table(name = "tb_user")
public class User {
    @Id
    @KeySql(useGeneratedKeys = true)
    private Long id;
    @Pattern(regexp = RegexPatterns.USERNAME_REGEX, message = "用户名不合法！")
    private String username;
    @Pattern(regexp = RegexPatterns.PASSWORD_REGEX, message = "密码不合法！")
    private String password;
    @Pattern(regexp = RegexPatterns.PHONE_REGEX, message = "手机号码不合法！")
    private String phone;
    private Date createTime;
    private Date updateTime;
}
